<% if spree_navigation_data.any? %>
  <div class="position-fixed text-uppercase d-xl-none mobile-navigation" role="navigation" aria-label="<%= Spree.t('nav_bar.mobile') %>">
    <div class="container d-flex align-items-center justify-content-between header-spree" data-hook>
      <button class="m-0 p-0" id="mobile-navigation-back-button" aria-label="<%= Spree.t('nav_bar.go_to_previous_menu') %>">
        <%= icon(name: 'arrow-right',
                classes: 'd-inline spree-icon-arrow spree-icon-arrow-left',
                width: 26,
                height: 26) %>
      </button>
      <figure class="logo header-spree-fluid-logo" data-hook>
        <%= logo %>
      </figure>
      <div id="top-nav-bar-mobile" class="m-0 p-0 header-spree-fluid-secondary-navigation" data-hook>
        <button id="mobile-navigation-close-button" aria-label="<%= Spree.t('nav_bar.close_menu') %>">
          <%= icon(name: 'close',
                  classes: 'd-inline',
                  width: 26,
                  height: 26) %>
        </button>
      </div>
    </div>

    <ul class="list-unstyled position-relative h-100 mobile-navigation-list">
      <% spree_navigation_data.each do |root| %>
        <li class="d-flex justify-content-between align-items-center mobile-navigation-list-item">
          <%= link_to root[:title], root[:url], class: 'w-75' %>
          <% if root[:items].present? %>
            <a class="w-25 text-right mobile-navigation-category-link" data-category="<%= root[:title].parameterize %>" href="#" aria-label="<%= Spree.t('go_to_category')%>">
              <%= icon(name: 'arrow-right',
                       classes: 'd-inline spree-icon-arrow spree-icon-arrow-right',
                       width: 14,
                       height: 27) %>
            </a>
            <ul class="list-unstyled position-absolute mobile-navigation-sublist" data-category="<%= root[:title].parameterize %>">
              <li class="text-center font-weight-bold mobile-navigation-sublist-header">
                <%= root[:title] %>
              </li>
              <% root[:items].each do |item| %>
                <li class="d-flex justify-content-between align-items-center mobile-navigation-list-item">
                  <%= link_to item[:title], item[:url], class: 'w-75' %>
                </li>
              <% end %>
            </ul>
          <% end %>
        </li>
      <% end %>
      <%= render partial: 'spree/shared/mobile_change_store' %>
    </ul>
  </div>
<% end %>
